package com.yxd.servlet;

import com.yxd.logging.SysLogger;

import javax.servlet.*;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by Administrator on 2016/6/15.
 */
public class PrimitiveServlet implements Servlet {

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        SysLogger.print("init");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        SysLogger.print("from servlet");
        PrintWriter writer = servletResponse.getWriter();
        writer.println("hello,I am servlet");
        writer.close();
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        SysLogger.print("destroy");
    }
}
